<?php
  include "include/config.inc.php";
  $deleteLoan = "DELETE FROM loan
                  WHERE loanId = ".$_REQUEST['loanId'];
  $deleteLoanRes = mysql_query($deleteLoan);
  if($deleteLoanRes)
  {
   	$deleteinstallment = "DELETE FROM installment 
  	                        WHERE loanId = ".$_REQUEST['loanId'];
  	$deleteinstallmentRes = mysql_query($deleteinstallment);
  	if(!$deleteinstallmentRes)
  	{
  		echo "Delete Fail";
  	}
  	else
  	{
  		header("Location:displayLoan.php");
  	}
  }
  else
  {
  	header("Location:displayLoan.php");
  }
?>